package Demo02;

import com.sun.tools.attach.AgentInitializationException;

public class Person {
    private int age;
    public void setAge(int age){
        if (age<1 || age>100) {
            System.out.println("年龄，不合法");
        }else {
            this.age=age;
        }
    }

    public int getAge(){
        return age;
    }
}
